package org.hackday.evetteam;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.EditText;
import android.widget.TextView;

public class EventCreationActivity extends Activity implements OnClickListener, OnItemClickListener {
	private Button createEvent;
	public void onCreate(Bundle creatingEvent){
		super.onCreate(creatingEvent);
		setContentView(R.layout.create_event);
		
		createEvent = (Button) findViewById(R.id.createEvent);
		this.createEvent.setOnClickListener(this);
		
	}
	
	 

	        public void onClick(View v) {

	    		
				String text = "Whoa! You haven't selected your current stop. Please pick one from the list!";
				
				int duration = Toast.LENGTH_SHORT;
			 Context context; 
				context = getApplicationContext();
				Toast toast = Toast.makeText(context, text, duration);
				//toast.setGravity(Gravity.CENTER, 0, 0);
				//toast.show();
			
				/*
				 *  <EditText android:id="@+id/eventname" android:layout_height="wrap_content" android:layout_width="306dp" android:layout_x="6dp" android:layout_y="104dp"></EditText>
       <EditText android:id="@+id/creatorname" android:inputType="textPersonName" android:layout_height="wrap_content" android:layout_width="306dp" android:layout_x="6dp" android:layout_y="30dp">
           <requestFocus></requestFocus>
       </EditText>
    	<TextView android:text="Vanue:" android:textSize="20px" android:layout_height="40px" android:padding="3dip" android:layout_width="119dp" android:layout_x="2dp" android:layout_y="154dp"></TextView>
    	<TextView android:text="Event Name:" android:textSize="20px" android:layout_height="40px" android:padding="3dip" android:layout_width="119dp" android:layout_x="-1dp" android:layout_y="79dp"></TextView>
    	<EditText android:id="@+id/vanue" android:inputType="textPostalAddress" android:layout_height="62dp" android:layout_width="306dp" android:layout_x="7dp" android:layout_y="183dp"></EditText>
    	<TextView android:text="Your Name:" android:textSize="20px" android:layout_height="wrap_content" android:padding="3dip" android:layout_width="wrap_content" android:layout_x="1dp" android:layout_y="8dp"></TextView>
    	<TextView android:text="Start Time:" android:textSize="20px" android:layout_height="wrap_content" android:padding="3dip" android:layout_width="wrap_content" android:layout_x="25dp" android:layout_y="250dp"></TextView>
    	<TextView android:text="End Time:" android:textSize="20px" android:layout_height="wrap_content" android:padding="3dip" android:layout_width="wrap_content" android:layout_x="192dp" android:layout_y="250dp"></TextView>
    	<EditText android:id="@+id/starttime" android:inputType="time" android:layout_height="wrap_content" android:layout_x="19dp" android:layout_y="275dp" android:layout_width="100dp"></EditText>
    	<EditText android:id="@+id/endtime" android:inputType="time" android:layout_height="wrap_content" android:layout_width="100dp" android:layout_x="180dp" android:layout_y="275dp"></EditText>
    	
				 */
			//startActivity(i1);
				
				EditText myText = (EditText) this.findViewById(R.id.eventname);

				// Setting the text:
				String i1=myText.getText().toString();
				//String i1= myText.getText() ;
				myText = (EditText) this.findViewById(R.id.creatorname);
				String i2=myText.getText().toString();
				
				myText = (EditText) this.findViewById(R.id.vanue);
				String i3=myText.getText().toString();
				
				myText = (EditText) this.findViewById(R.id.starttime);
				String i4=myText.getText().toString();
				
				myText = (EditText) this.findViewById(R.id.endtime);
				String i5=myText.getText().toString();
				 
				Intent i = new Intent(this, createEvent.class);
                
                i.putExtra("eventname",i1);
                
                i.putExtra("creatorname",i2);
                
                i.putExtra("venue",i3);
                
                i.putExtra("starttime",i4);
                
                i.putExtra("starttime",i5);
                
                startActivity(i);
	}

	public void onItemClick(AdapterView<?> arg0, View arg1, int listIndex,
			long arg3) {
		
	}
	 
}
